<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('库存明细列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>巷道编号：</label>
                                <input type="text" name="roadwayId"/>
                            </li>
                            <li>
                                <label>货位名称：</label>
                                <input type="text" name="cargoSpaceName"/>
                            </li>
                            <li>
                                <label>托盘条码：</label>
                                <input type="text" name="trayCode"/>
                            </li>
                            <li>
                                <label>物料编号：</label>
                                <input type="text" name="productId"/>
                            </li>
                            <li>
                                <label>物料名称：</label>
                                <input type="text" name="productName"/>
                            </li>
                            <li>
                                <label>规格说明：</label>
                                <input type="text" name="productSpec"/>
                            </li>
                            <li>
                                <label>比例号：</label>
                                <input type="text" name="sizeNo"/>
                            </li>
                            <li>
                                <label>供应商：</label>
                                <input type="text" name="supplierName"/>
                            </li>
                            <li>
                                <label>拣选标志：</label>
                                <select name="pickFlag">
                                    <option value="">所有</option>
                                    <option value="0">未拣选</option>
                                    <option value="1">已拣选</option>
                                </select>
                            </li>
                            <li>
                                <label>入库类型：</label>
                                <select name="inType" th:with="type=${@dict.getType('in_job')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>入库时间：</label>
                                <input type="text" class="time-input" data-type="datetime" placeholder="请单击选择开始时间：" name="startTime" id="startTime"/>---
                                <input type="text" class="time-input" data-type="datetime" placeholder="请单击选择结束时间：" name="finishTime" id="finishTime"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('formId','bootstrap-table')"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('formId','bootstrap-table')"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-warning" onclick="$.table.exportExcel()">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-bordered">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:viewStockDetail:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:viewStockDetail:remove')}]];
        var inTypeDatas = [[${@dict.getType('in_job')}]];
        var prefix = ctx + "search/viewStockDetail";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "库存明细",
                pageSize: 10,
                pageList: [10,25,50],
                clickToSelect: true,//是否启用点击选中行
                uniqueId:"stockId",//表主键(用于修改和删除)
                sortName:"stockId",//必加排序 sortOrder: "asc"默认
                columns: [
                {
                    halign: 'center',
                    align:'center',
                    checkbox: true
                },
                {
                    field: 'stockId',
                    title: '库存编号',
                    halign: 'center',
                    align:'center',
                    visible: true
                },
                {
                    field: 'roadwayId',
                    title: '巷道编号',
                    halign: 'center',
                    align:'center',
                    visible: true
                },
                {
                    field: 'cargoSpaceId',
                    title: '货位编号',
                    halign: 'center',
                    align:'center',
                    visible: false
                },
                {
                    field: 'cargoSpaceName',
                    title: '货位名称',
                    halign: 'center',
                    align:'center',
                    visible: true
                },
                {
                    field: 'trayCode',
                    title: '托盘条码',
                    halign: 'center',
                    align:'center',
                    visible: true
                },
                {
                    field: 'productId',
                    title: '物料编号',
                    halign: 'center',
                    align:'center',
                    visible: true
                },
                {
                    field: 'productName',
                    title: '物料名称',
                    halign: 'center',
                    align:'center',
                    visible: true
                },
                {
                    field: 'productSpec',
                    title: '规格说明',
                    halign: 'center',
                    align:'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'sizeNo',
                    title: '比例号',
                    halign: 'center',
                    align:'center',
                    visible: true
                },
                {
                    field: 'supplierName',
                    title: '供应商',
                    halign: 'center',
                    align:'center',
                    visible: true
                },
                {
                    field: 'quantity',
                    title: '数量',
                    halign: 'center',
                    align:'center',
                    visible: true
                },
                {
                    field: 'stackingId',
                    title: '垛型',
                    halign: 'center',
                    align:'center',
                    visible: true
                },
                {
                    field: 'pickFlag',
                    title: '拣选标志',
                    halign: 'center',
                    align:'center',
                    visible: true,
                    formatter: function (value, index, row){
                        if (value == 0){
                            return "未拣选";
                        } else if (value == 1){
                            return "已拣选";
                        }
                    }
                },
                {
                    field: 'inType',
                    title: '入库类型',
                    halign: 'center',
                    align:'center',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(inTypeDatas, value);
                    }
                },
                {
                    field: 'inDate',
                    title: '入库时间',
                    halign: 'center',
                    align:'center',
                    visible: true
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>